#pragma once

#include "Texture2D.h"
#include "UniformBuffer.h"
#include "XVulkan.h"

class Material
{
  public:
    XProgram mProgram;
    XFixedPipeline *mFixedPipeline;
    UniformBuffer *mVertexVec4UBO;
    UniformBuffer *mVertexMat4UBO;
    UniformBuffer *mFragVec4UBO;
    UniformBuffer *mFragMat4UBO;
    Texture2D mTexture[8];

  public:
    Material();
    ~Material();

    void Init(const char *vs, const char *fs = nullptr);
    void SetFixedPipeline(XFixedPipeline *pipeline);
    void SetTexture(int binding, XTexture *texture);
    void SetMVP(const glm::mat4 &m, const glm::mat4 &v, const glm::mat4 &p);
    void Finish();
    void SubmitUniformBuffers();
};
